from .provider import BaseProvider
from ..common import ModelParameter

from enum import Enum

class LLMProvider(Enum):
    """Supported LLM providers."""
    OPENAI = "openai"
    OLLAMA = "ollama"

class LLMClient:
    """Main LLM client that supports multiple providers."""

    def __init__(self, provider: str | LLMProvider, model_param: ModelParameter):
        if isinstance(provider, str):
            provider = LLMProvider(provider)
        self.provider=provider
        match provider:
            case LLMProvider.OPENAI:
                from .openai import OpenAIProvider
                self.client: BaseProvider = OpenAIProvider(model_param)
            case LLMProvider.OLLAMA:
                from .ollama import OllamaProvider
                self.client: BaseProvider = OllamaProvider(model_param)